]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/rails-i18n/tools/Rails I18n.tmbundle/Commands/Lookup Translation.tmCommand
Go back to the rails 3 based upstream version of session-persistence
[rails.git] / vendor / plugins / rails-i18n / tools / Rails I18n.tmbundle / Commands / Lookup Translation.tmCommand
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0">
4 <dict>
5         <key>beforeRunningCommand</key>
6         <string>nop</string>
7         <key>command</key>
8         <string>#!/usr/bin/ruby 
9 require 'rubygems'
10 require 'i18n'
11 I18n.locale = :en
12 I18n.load_path &lt;&lt; File.join(ENV['TM_PROJECT_DIRECTORY'], 'config', 'locales', 'en.yml')
13
14 class &lt;&lt; Object
15   def const_missing(const)
16     nil
17   end
18 end
19
20 def method_missing(method, *args)
21   "**#{method}**"
22 end
23
24 def t(*args)
25   I18n.t(*args)
26 end
27
28 def args_to_array(*args)
29   args
30 end
31
32 args = eval('args_to_array(' + ENV['TM_SELECTED_TEXT'] + ')')
33
34 if args.last.is_a?(Hash)
35   args.last.each { |k, v| args.last[k] = "**#{k}**" if v.nil? }
36 end
37
38 print I18n.t(*args)
39 </string>
40         <key>fallbackInput</key>
41         <string>none</string>
42         <key>input</key>
43         <string>selection</string>
44         <key>keyEquivalent</key>
45         <string>@I</string>
46         <key>name</key>
47         <string>Lookup Translation</string>
48         <key>output</key>
49         <string>showAsTooltip</string>
50         <key>uuid</key>
51         <string>7DAF30C3-0247-4E94-AA44-DD2E69A6E236</string>
52 </dict>
53 </plist>